


//
//  ZCJHomeCell.m
//  庐山通
//
//  Created by mac22 on 14/10/19.
//  Copyright (c) 2014年 郑朝军. All rights reserved.
//

#import "ZCJHomeCell.h"
#import "ZCJHomeTopView.h"
#import "Grouble.h"
#import "MyDataFrame.h"

@interface ZCJHomeCell()

/** 顶部的view */
@property (nonatomic, weak) ZCJHomeTopView *topView;
@end

@implementation ZCJHomeCell

+ (instancetype)ZCJHomeCell:(UITableView *)tableView
{
    static NSString * ID = @"homecell";
    ZCJHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[ZCJHomeCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addTopViews];
    }
    return self;
}
- (void)setFrame:(CGRect)frame
{
    frame.origin.y += ZCJHomeTableBorder;
    frame.origin.x = ZCJHomeTableBorder;
    frame.size.width -= 2 * ZCJHomeTableBorder;
    frame.size.height -= ZCJHomeTableBorder;
    [super setFrame:frame];
}
- (void)addTopViews
{
    // 0.设置cell选中时的背景
    self.selectedBackgroundView = [[UIView alloc] init];
    self.backgroundColor = [UIColor clearColor];
    
    /** 1.顶部的view */
    ZCJHomeTopView *topView = [[ZCJHomeTopView alloc] init];
    [self.contentView addSubview:topView];
    self.topView = topView;
}
- (void)setItemsFrame:(MyDataFrame *)itemsFrame
{
    _itemsFrame = itemsFrame;
    [self setHomeView];
    
}
- (void)setHomeView
{
    
    // 1.topView
    self.topView.frame = self.itemsFrame.topViewF;
    
    // 2.传递模型数据
    //self.topView.statusFrame = self.statusFrame;
}



@end
